var multiIdsChecked;//选取的multiIds
//应用标签
function applyTags(tagNames){
	var multiIds=$j("#contentListForm :input[name='multiIds']").serializeArray();
	if(multiIds.length>0){
		var postData = $j("#contentListForm :input[name='multiIds']").serializeArray();
		postData.push({name:"tagNames",value:tagNames});
		$j.post(__ctxPath + "/content/content/blank.html?doAction=applyTags", postData, applyTagsCallback,"json");
		return true;
	}else{
		alert(__FMT.contentList_selectContent);
		return false;
	}
}
//应用标签callback
function applyTagsCallback(data){
	if(data.error != undefined && data.error != ""){
		alert(data.error);
	}
	tagSelectorRefreshTagChooser(); //更新tagSelector
	multiIdsChecked = $j("#contentListForm :input[name='multiIds']:checked");
	multiIdsCheckedRefreshCustomerList();
}

//关闭管理窗口callback
function manageTags(){
	tagSelectorRefreshTagChooser(); //更新tagSelector
	multiIdsChecked = $j("#contentListForm :input[name='multiIds']:checked");
	multiIdsCheckedRefreshCustomerList();
}

//刷新内容列表并保留选取项
function multiIdsCheckedRefreshCustomerList(){
	postData = $j('#contentResults :input').serializeArray();
	url=__ctxPath+"/content/content/blank.html?doAction=search";
	$j("#contentResults").load(url,postData,multiIdsCheckedCallback);  
}

//设置multiId选取
function multiIdsCheckedCallback(){
	if (multiIdsChecked.length > 0) {	
		for (var index = 0; index < multiIdsChecked.length; index++) {
			$j("#" + multiIdsChecked[index].id).attr("checked", "true");
		}
	}
}

